syntax = "proto3";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
<#if serverName == "runserver">
option java_package="com.lgywin.runserver.protobuf";
<#else>
option java_package="com.lgywin.userserver.protobuf";
</#if>
option java_outer_classname="GameDataProto";
option java_multiple_files=true;

package protobuf;
<#--
//创建一个 User 对象
message User{
    //list Int
    repeated int32 intList = 1;
    //list String
    repeated string strList = 5;
}
 注释
<#if protoMap?exists>
    <#list protoMap?keys as key>
//${protoMap[key]}
message ${key}{
    <#if beanMap?exists>
        <#list beanMap[key] as bean>
    //${bean.remark}
    ${bean.type} ${bean.name};
        </#list>
    </#if>
}
    </#list>
</#if>
随机字符串
RandomStringUtils.randomAlphanumeric(10)
-->
message NetProto {
    int32 protoCode = 1;
    int32 retCode = 2;
    repeated google.protobuf.Any cls = 3;
}

<#list protoList as entity>
//${entity.remark}
message ${entity.name}{
    <#list entity.fieldList as field>
    <#if field.type.flag==3>map<string,<#elseif field.type.flag==2>repeated </#if><#if field.type.flag==3>${field.type.protoType}><#else>${field.type.protoType}</#if> ${field.name}=${field_index+1};
    </#list>
}
</#list>